<?php

namespace app\controller;

use app\BaseController;
use app\utils\FilesUtils;
use app\utils\QRCodeUtils;
use think\App;

class ItineraryController extends BaseController
{
    public function __construct(App $app)
    {

        parent::__construct($app);
    }

    public function uploadFile2QRCode(){
        $filesUtils = new FilesUtils();
        $QRCodeUtils = new QRCodeUtils();
        $uploadedFile = $this->request->file('file');


        $savePath = $filesUtils->save('itinerary', $uploadedFile);

        $QRcode = $QRCodeUtils->create(env('app.storageaddress').$savePath['url']);

        return $this->returnJson(env('app.netaddress').$QRcode);

    }
}